// --------------------------------------------------------------------------------------------------------------------
// <copyright file="UcRegisteredServer.cs" company="SmartPlan">
//   SmartPlan 2011
// </copyright>
// <summary>
//   The uc registered server.
// </summary>
// --------------------------------------------------------------------------------------------------------------------


namespace DbDiff.WinClient.Forms.DbItems
{
    using System.ComponentModel;
    using System.Windows.Forms;
    using Common.Model;

    /// <summary>
    /// The uc registered server.
    /// </summary>
    public class UcRegisteredServer : UcDbDiffBase
    {
        /// <summary>
        /// The _registered server.
        /// </summary>
        private readonly RegisteredServer _registeredServer;

        /// <summary>
        /// The label 1.
        /// </summary>
        protected Label label1;

        /// <summary>
        /// The label 2.
        /// </summary>
        protected Label label2;

        /// <summary>
        /// The lbl user.
        /// </summary>
        protected Label lblUser;

        /// <summary>
        /// The txt auth type.
        /// </summary>
        protected TextBox txtAuthType;

        /// <summary>
        /// The txt server.
        /// </summary>
        protected TextBox txtServer;

        /// <summary>
        /// The txt user name.
        /// </summary>
        protected TextBox txtUserName;

        /// <summary>
        /// Initializes a new instance of the <see cref="UcRegisteredServer"/> class.
        /// </summary>
        public UcRegisteredServer()
        {
            // This call is required by the Windows Form Designer.
            this.InitializeComponent();
            this._registeredServer = new RegisteredServer("TESZT");
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UcRegisteredServer"/> class.
        /// </summary>
        /// <param name="registeredServer">
        /// The registered server.
        /// </param>
        public UcRegisteredServer(RegisteredServer registeredServer)
        {
            // This call is required by the Windows Form Designer.
            this.InitializeComponent();

            // TODO: Add any initialization after the InitializeComponent call
            this._isButtons = false;
            this._registeredServer = registeredServer;
        }

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">
        /// The disposing.
        /// </param>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
            }

            base.Dispose(disposing);
        }

        /// <summary>
        /// The update data.
        /// </summary>
        protected override void UpdateData()
        {
            this.txtServer.Text = this._registeredServer.Name;
            this.txtAuthType.Text = this._registeredServer.AuthType.ToString();
            this.txtUserName.Text = this._registeredServer.User;
        }

        #region Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.txtServer = new System.Windows.Forms.TextBox();
            this.label1 = new System.Windows.Forms.Label();
            this.txtAuthType = new System.Windows.Forms.TextBox();
            this.txtUserName = new System.Windows.Forms.TextBox();
            this.lblUser = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.panelMain.SuspendLayout();
            this.panelButton.SuspendLayout();
            this.SuspendLayout();
            // 
            // panelMain
            // 
            this.panelMain.Controls.Add(this.txtAuthType);
            this.panelMain.Controls.Add(this.txtUserName);
            this.panelMain.Controls.Add(this.lblUser);
            this.panelMain.Controls.Add(this.label2);
            this.panelMain.Controls.Add(this.txtServer);
            this.panelMain.Controls.Add(this.label1);
            this.panelMain.Name = "panelMain";
            // 
            // panelButton
            // 
            this.panelButton.Name = "panelButton";
            // 
            // btnOk
            // 
            this.btnOk.Name = "btnOk";
            // 
            // btnCancel
            // 
            this.btnCancel.Name = "btnCancel";
            // 
            // btnModify
            // 
            this.btnModify.Name = "btnModify";
            // 
            // btnDelete
            // 
            this.btnDelete.Name = "btnDelete";
            // 
            // btnNew
            // 
            this.btnNew.Name = "btnNew";
            // 
            // btnClose
            // 
            this.btnClose.Name = "btnClose";
            // 
            // txtServer
            // 
            this.txtServer.Location = new System.Drawing.Point(104, 8);
            this.txtServer.Name = "txtServer";
            this.txtServer.ReadOnly = true;
            this.txtServer.Size = new System.Drawing.Size(232, 20);
            this.txtServer.TabIndex = 26;
            this.txtServer.Text = "";
            // 
            // label1
            // 
            this.label1.Location = new System.Drawing.Point(8, 8);
            this.label1.Name = "label1";
            this.label1.TabIndex = 25;
            this.label1.Text = "Server";
            this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            // 
            // txtAuthType
            // 
            this.txtAuthType.Location = new System.Drawing.Point(104, 32);
            this.txtAuthType.Name = "txtAuthType";
            this.txtAuthType.ReadOnly = true;
            this.txtAuthType.Size = new System.Drawing.Size(152, 20);
            this.txtAuthType.TabIndex = 30;
            this.txtAuthType.Text = "";
            // 
            // txtUserName
            // 
            this.txtUserName.Location = new System.Drawing.Point(104, 56);
            this.txtUserName.Name = "txtUserName";
            this.txtUserName.ReadOnly = true;
            this.txtUserName.Size = new System.Drawing.Size(152, 20);
            this.txtUserName.TabIndex = 28;
            this.txtUserName.Text = "";
            // 
            // lblUser
            // 
            this.lblUser.Location = new System.Drawing.Point(8, 56);
            this.lblUser.Name = "lblUser";
            this.lblUser.Size = new System.Drawing.Size(72, 23);
            this.lblUser.TabIndex = 29;
            this.lblUser.Text = "User";
            this.lblUser.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            // 
            // label2
            // 
            this.label2.Location = new System.Drawing.Point(8, 32);
            this.label2.Name = "label2";
            this.label2.TabIndex = 27;
            this.label2.Text = "Authentication";
            this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            // 
            // UcRegisteredServer
            // 
            this.Name = "UcRegisteredServer";
            this.panelMain.ResumeLayout(false);
            this.panelButton.ResumeLayout(false);
            this.ResumeLayout(false);

        }
        #endregion
    }
}